import Relay from "react-relay";

export default class SaveImageMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { saveImage }`;
    }

    getVariables() { 
        return {
            argsInput: {
                realName:this.props.realName,
                token:this.props.token,
                url:this.props.url
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on saveImagePayload {
            saveImage {
                errorCode
                totalResult
                value
                imageStorge{
                    imageUrl
                    sid
                    realName
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
               fragment on saveImagePayload {
                    saveImage {
                        errorCode
                        totalResult
                        value
                        imageStorge{
                            imageUrl
                            sid
                            realName
                        }
                    }
             }
            `]
        }];
    }

}
